<template>
    <div class="app-container">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" >
        <el-form-item label="案件编号" prop="ajbh">
          <el-input
            v-model="queryParams.ajbh"
            placeholder="请输入案件编号"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="被取保候审人(被行政拘留人)" prop="hsr">
          <el-input
            v-model="queryParams.hsr"
            placeholder="请输入被取保候审人(被行政拘留人)"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="没收状态" prop="mszt">
            <el-select v-model="queryParams.mszt" clearable  placeholder="请选择">
                <el-option
                v-for="item in option"
                :key="item.mszt"
                :label="item.label"
                :value="item.mszt">
                </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="没收审核状态" prop="msshzt">
            <el-select v-model="queryParams.msshzt" clearable  placeholder="请选择">
                <el-option
                v-for="item in options"
                :key="item.msshzt"
                :label="item.label"
                :value="item.msshzt">
                </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="没收开始日期" prop="ksrq">
            <el-date-picker clearable
                v-model="queryParams.ksrq"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="请选择没收开始日期">
            </el-date-picker>
            </el-form-item>
            <el-form-item label="没收截至日期" prop="jsrq">
            <el-date-picker clearable
                v-model="queryParams.jsrq"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="请选择没收截至日期">
            </el-date-picker>
            </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-form>

    <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button
            type="warning"
            plain
            icon="el-icon-download"
            size="mini"
            @click="handleExport"
            v-hasPermi="['system/bzjtable/export']"
          >导出</el-button>
        </el-col>
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>
  
      <el-table v-loading="loading" :data="bzjtableList" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="50" align="center" />
        <el-table-column label="序号" align="center" prop="xh" />
        <el-table-column label="案件编号" align="center" prop="ajbh" width="220"/>
        <el-table-column label="案件名称" align="center" prop="ajmc" width="220"/>
        <el-table-column label="收取法律文书号" align="center" prop="sqwsh" width="220"/>
        <el-table-column label="被取保候审人(被行政拘留人)" align="center" prop="hsr" width="100"/>
        <el-table-column label="人员类别" align="center" prop="xjr" width="100"/>
        <el-table-column label="性别" align="center" prop="xb" />
        <el-table-column label="出生日期" align="center" prop="csrq" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.csrq, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="住址" align="center" prop="zz" width="300"/>
        <el-table-column label="户籍地址" align="center" prop="hjdz" width="300"/>
        <el-table-column label="单位及职务" align="center" prop="dwzw" width="180"/>
        <el-table-column label="联系电话" align="center" prop="lxdh" width="150"/>
        <el-table-column label="身份证号" align="center" prop="sfzh" width="180"/>
        <el-table-column label="案件性质" align="center" prop="ajxz" width="200"/>
        <el-table-column label="没收批准人" align="center" prop="mspzr" />
        <el-table-column label="没收法律文书号" align="center" prop="mswsh" />
        <el-table-column label="没收批准时间" align="center" prop="mspzsj" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.mspzsj, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="没收日期" align="center" prop="msrq" />
        <el-table-column label="没收填报时间" align="center" prop="mstfsj" />
        <el-table-column label="没收金额" align="center" prop="msje" />
        <el-table-column label="没收填报人" align="center" prop="mstfr" />
        <el-table-column label="没收原因" align="center" prop="msyy" />
        <el-table-column label="委托代交款人" align="center" prop="jkr" width="120"/>
        <el-table-column label="委托交款人身份证" align="center" prop="jkrsfz" width="150"/>
        <el-table-column label="收款银行" align="center" prop="dsyhbh" width="150"/>
        <el-table-column label="缴款时间" align="center" prop="jnsj" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.jnsj, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="交纳银行卡号" align="center" prop="jnkh" width="150"/>
        <el-table-column label="批准人" align="center" prop="pzr" />
        <el-table-column label="取保候审批准时间" align="center" prop="pzsj" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.pzsj, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="办案人" align="center" prop="bar" width="150"/>
        <el-table-column label="办案单位" align="center" prop="badw" width="300"/>
        <el-table-column label="填报时间" align="center" prop="sqtfsj" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.sqtfsj, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="填报人" align="center" prop="sqtfr" />
        <el-table-column label="单据状态" align="center" prop="djzt" />
        <el-table-column label="没收打印状态" align="center" prop="msdyzt" width="120"/>
        <el-table-column label="单据时间" align="center" prop="djsj" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.djsj, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
      </el-table>
      
      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
    </div>
  </template>
  
  <script>
  import { msReport } from "@/api/system/bzjtable";
  
  export default {
    name: "Bzjtable",
    data() {
      return {
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 【请填写功能名称】表格数据
        bzjtableList: [],
        // 弹出层标题
        title: "",
        // 日期范围
        dateRange: [],
        // 是否显示弹出层
        open: false,
        dialogOpen: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          mszt : '',
          msshzt : '',
          ajbh: null,
          hsr: null,
          ksrq: '',
          jsrq:''
        },
        // 表单参数
        form: {},
        // 表单校验
        rules: {
        },
        option: [{
          mszt: '1',
          label: '已没收'
        }, {
          mszt: '0',
          label: '未没收'
        }],
        mszt: '',
        options: [{
          msshzt: '1',
          label: '正在审核'
        }, {
          msshzt: '2',
          label: '审核通过'
        }, {
          msshzt: '3',
          label: '审核未通过'
        }],
        msshzt: ''
      };
    },
    created() {
      this.getList();
    },
    methods: {
      /** 查询【请填写功能名称】列表 */
      getList() {
        this.loading = true;
        msReport(this.queryParams).then(response => {
          this.bzjtableList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          xh: null,
          ajbh: null,
          ajmc: null,
          sqwsh: null,
          hsr: null,
          xjr: null,
          xb: null,
          csrq: null,
          zz: null,
          hjdz: null,
          dwzw: null,
          lxdh: null,
          sfzh: null,
          ajxz: null,
          sqje: null,
          sqfs: null,
          sqzt: null,
          jkr: null,
          jkrsfz: null,
          dsyhbh: null,
          jnsj: null,
          jnkh: null,
          pzr: null,
          pzsj: null,
          bar: null,
          dwbh: null,
          badw: null,
          sqrq: null,
          sqtfsj: null,
          sqtfr: null,
          msje: null,
          mszt: null,
          msyy: null,
          mswsh: null,
          mspzr: null,
          mspzsj: null,
          mstfr: null,
          msrq: null,
          mstfsj: null,
          msshzt: null,
          mskhzt: null,
          mskhsj: null,
          mskhczr: null,
          thje: null,
          thfs: null,
          thzt: null,
          thrq: null,
          thwsh: null,
          thpzr: null,
          thtfsj: null,
          thshzt: null,
          thshr: null,
          thshsj: null,
          thxm: null,
          thzh: null,
          thkhh: null,
          djzt: null,
          sqdyzt: null,
          djsj: null,
          sqkpzt: null,
          thkpzt: null,
          hbwsh: null,
          hbdw: null,
          hbje: null,
          hbry: null,
          hbrq: null,
          hblxdh: null,
          hbsj: null,
          hbczy: null,
          thtfr: null
        };
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.xh)
        this.single = selection.length!==1
        this.multiple = !selection.length
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.dateRange = [];
        this.resetForm("queryForm");
        this.handleQuery();
      },
      /** 导出按钮操作 */
      handleExport() {
        this.download('system/bzjtable/export', {
          ...this.queryParams
        }, `bzjtable_${new Date().getTime()}.xlsx`)
      }
    }
  };
  </script>
  